import Vue from 'vue'
import VueRouter from 'vue-router'
import home from "@/views/home.vue";
import info from "@/views/info.vue";
import login from "@/views/login.vue";
import SelectExcel from "@/views/excel/select-excel.vue";
import Material from "@/views/Material.vue";
import JieTi from "@/views/JieTi.vue";
import PDF from "@/views/pdf/PDF.vue";
import Research from "@/views/research.vue";
import Register from "@/views/Register.vue";
import Profile from "@/components/profile/Profile.vue";

Vue.use(VueRouter)

const routes = [
    {
        path: '/',
        component: login,
        hidden: true,
        meta: {
            requireAuth: false
        }
    }, {
        path: '/login',
        name: '登录',
        component: login,
        hidden: true,
        meta: {
            requireAuth: false
        }
    },
    {
        path: '/register',
        name: '注册',
        component: Register,
        hidden: true,
        meta: {
            requireAuth: false
        }
    },
    {
        path: '/research',
        component: home,
        meta: {
            requireAuth: true
        },
        children: [
            {
                path: "/research",
                component: Research,
                redirect: '/research/research',
                meta:
                    {
                        requireAuth: true
                    },
                children:
                    [
                        {
                            path: "research",
                            name: "research",
                            component: () => import("@/components/Research/ResearchList.vue")
                        },
                        {
                            path: "govresearch",
                            name: "govresearch",
                            component: () => import("@/components/Govresearch/GovresearchList.vue")
                        }
                    ]
            },
            {
                path: "researchupload",
                name: "researchupload",
                component: () => import('@/components/Research/ResearchUpload.vue'),
            },
            {

                path: "govresearchUpload",
                name: "govresearchUpload",
                component: () => import('@/components/Govresearch/GovresearchUpload.vue'),
            },
            {
                path: 'excel',
                name: 'excel',
                component: SelectExcel,
                hidden: true,
                meta: {
                    requireAuth: false
                }
            },]
    },

    {
        path: '/paper',
        component: home,
        meta: {
            requireAuth: true
        },
        children: [
            {
                path: '/profile',
                name: 'profile',
                component: Profile,
                hidden: true,
                meta: {
                    requireAuth: false
                }
            },
            {
                path: "/paper",
                component: info,
                redirect: '/paper/paper',
                meta:
                    {
                        requireAuth: true
                    },
                children:
                    [
                        {
                            path: "paper",
                            name: "paper",
                            meta: {
                                requireAuth: true
                            },
                            component: () => import("@/components/Paper/PaperList.vue")
                        },
                        {
                            path: "patent",
                            name: "patent",
                            component: () => import("@/components/Patent/PatentList.vue")
                        },
                        {
                            path: "software",
                            name: "software",
                            component: () => import("@/components/Software/SoftwareList.vue")
                        },
                        {
                            path: "award",
                            name: "award",
                            component: () => import("@/components/Award/AwardList.vue")
                        },
                        {
                            path: "stuaward",
                            name: "stuaward",
                            component: () => import("@/components/Stuaward/StuawardList.vue")
                        },
                        {
                            path: "material",
                            name: "material",
                            component: () => import("@/components/Material/MaterialList.vue")
                        },
                        {
                            path: "book",
                            name: "book",
                            component: () => import("@/components/Book/BookList.vue")
                        },
                        {
                            path: "report",
                            name: "report",
                            component: () => import("@/components/Report/ReportList.vue")
                        },
                        {
                            path: "certificate",
                            name: "certificate",
                            component: () => import("@/components/Certificate/CertificateList.vue")
                        },
                        {
                            path: "others",
                            name: "others",
                            component: () => import("@/components/Other/OtherList.vue")
                        },
                        {
                            path: "recycled",
                            name: "recycled",
                            component: () => import("@/components/Recycled/RecycledList.vue")
                        },

                    ]
            },
            {

                path: "paperupload",
                name: "paperupload",
                component: () => import("@/components/Paper/PaperUpload.vue"),
            },
            {

                path: "bookupload",
                name: "bookupload",
                component: () => import('@/components/Book/BookUpload.vue'),
            },
            {

                path: "awardupload",
                name: "awardupload",
                component: () => import('@/components/Award/AwardUpload.vue'),
            },
            {

                path: "Certificateupload",
                name: "Certificateupload",
                component: () => import('@/components/Certificate/CertificateUpload.vue'),
            },
            {

                path: "reportupload",
                name: "reportupload",
                component: () => import('@/components/Report/ReportUpload.vue'),
            },
            {

                path: "patentupload",
                name: "patentpload",
                component: () => import('@/components/Patent/PatentUpload.vue'),
            },
            {

                path: "stuawardupload",
                name: "stuawardupload",
                component: () => import('@/components/Stuaward/StuawardUpload.vue'),
            },
            {

                path: "materialupload",
                name: "materialupload",
                component: () => import('@/components/Material/MaterialUpload.vue'),
            },
            {

                path: "softwareupload",
                name: "softwareupload",
                component: () => import('@/components/Software/SoftwareUpload.vue'),
            },
            {

                path: "othersupload",
                name: "othersupload",
                component: () => import('@/components/Other/OtherUpload.vue'),
            },
            {

                path: "othersupload",
                name: "othersupload",
                component: () => import('@/components/Other/OtherUpload.vue'),
            },
            {
                path: "researchupload",
                name: "researchupload",
                component: () => import('@/components/Research/ResearchUpload.vue'),
            },
            {

                path: "govresearchUpload",
                name: "govresearchUpload",
                component: () => import('@/components/Govresearch/GovresearchUpload.vue'),
            },
            {
                path: "getmaterial",
                name: "getmaterial",
                component: Material,
            },

            {
                path: 'excel',
                name: 'excel',
                component: SelectExcel,
                hidden: true,
                meta: {
                    requireAuth: false
                }
            }, {
                path: 'jieti',
                name: 'jieti',
                component: JieTi,
                hidden: true,
                meta: {
                    requireAuth: false
                }
            },
            {
                path: 'pdf',
                name: 'pdf',
                component: PDF,
                hidden: true,
                meta: {
                    requireAuth: false
                }
            },
        ]
    },

]

const router = new VueRouter({
    mode: "hash",
    routes
})


export default router
